# from .views import login
from django.urls import path
from rest_framework.routers import DefaultRouter

from apps.meiduo_admin.login import AdminJsonWebTokenAPIView
from apps.meiduo_admin.views.imageview import ImageModelView, SkuView, SkuAllView, CategoryView, SPUListAPIView, \
    SPUSpecsView, BrandView, SPUView,SpecListAPIView, SpecsModelViewSet, \
    SpecsModelViewSet2, GoodsChannelModelViewSet, BrandModelViewSet, CategoriesListAPIView, \
    CategoriesListAPIView2, OrderinfoView, StatusView
from apps.meiduo_admin.views.permissionview import PermissionView, ContentTypeView, GroupView, SimplePermissionView, \
    AdminView, AdminListAPIView
from apps.meiduo_admin.views.user import UserView, AAA
from apps.meiduo_admin.views.user_days import UserDailyActiveCountView, UserOrderCountView, EveryMonthUserView, \
    DailyAddView, TotalView, GoodView,AA
from orderview import OrderStatusView, OrderModelViewSet

urlpatterns = [

    # 登录时的用户权限校验

    path('authorizations/', AdminJsonWebTokenAPIView.as_view()),#登录后的token校验
    # 1.日活用户
    path('statistical/day_active/', UserDailyActiveCountView.as_view()),
    # 2.下订单用户
    path('statistical/day_orders/', UserOrderCountView.as_view()),
    path('statistical/month_increment/', EveryMonthUserView.as_view()),
    # 3.  月增用户
    path('statistical/month_increment/', AA.as_view()),
    # 4.日增用户
    path('statistical/day_increment/', DailyAddView.as_view()),
    # 5. 用户总数
    path('statistical/total_count/', TotalView.as_view()),
    # 6.  商品访问量
    path('statistical/goods_day_views/', GoodView.as_view()),
    # 商品访问量
    path('statistical/goods_day_views/', GoodView.as_view()),

    # 这是用户的增删改的路由
    path('users/',AAA.as_view()),



    #s\获取sku的全部数据
    path('skus/simple/',SkuAllView.as_view()),
    path('skus/categories/',CategoryView.as_view()),
    path('goods/simple/',SPUListAPIView.as_view()),
    path('goods/<int:pk>/specs/',SPUSpecsView.as_view()),


    # 这是品牌的简单实现
    path('goods/brands/simple/',BrandView.as_view()),
    # 这是频道数据的显示
    path('goods/channel/categories/',CategoriesListAPIView2.as_view()),
    # 这是频道数据的三级分类
    path('goods/channel/categories/<int:pk>/',CategoriesListAPIView2.as_view()),







    # 这是用户权限类型的路由
    path('permission/content_types/',ContentTypeView.as_view()),
    # 这是用户权限简单实现的路由
    path('permission/simple/',SimplePermissionView.as_view()),
    # 这是权限组的简单显示
    path('permission/groups/simple/',AdminListAPIView.as_view()),




    # 这是规格
    path('goods/<int:pk>/specs/',SpecListAPIView.as_view()),
    # 这是规格数据的简单显示
    path('goods/specs/simple/',SpecListAPIView.as_view()),

    # 这是频道的获取数据的,,,,每一级分类的数据
    path('goods/brands/simple/',BrandView.as_view()),

    path('goods/channel/categories/',CategoriesListAPIView2.as_view()),
    path('goods/channel/categories/<int:pk>/',CategoriesListAPIView2.as_view()),


    path('goods/channel_types/',CategoriesListAPIView.as_view()),
    path('goods/categories/',CategoriesListAPIView2.as_view()),



































    path('orders/<int:pk>/status/',OrderStatusView.as_view()),













]

# 这是上传图片的增删改查
router  = DefaultRouter()
router.register('skus/images',ImageModelView)
urlpatterns +=router.urls




# 这是用户权限的路由
router.register('permission/perms',PermissionView,basename='perms')
urlpatterns += router.urls

# 这是用户权限组的路由
router.register('permission/groups',GroupView,basename='group')
urlpatterns += router.urls

# 这是用户管理员
router.register('permission/admins',AdminView,basename='admin')
urlpatterns += router.urls


# 这是规格管理的增删改查
router.register('goods/specs',SpecsModelViewSet)
urlpatterns +=router.urls

# 这是规格选项的增删改查
router.register('specs/options',SpecsModelViewSet2)
urlpatterns +=router.urls


# 这是频道的管理的增删改查
router.register('goods/channels',GoodsChannelModelViewSet)
urlpatterns +=router.urls



# 这是品牌的管理的增删改查
router.register('goods/brands',BrandModelViewSet)
urlpatterns +=router.urls


# 这是sku的增删改查
router.register('skus',SkuView,basename='skus')
urlpatterns +=router.urls

# 这是spu的增删改查
router.register('goods',SPUView)
urlpatterns +=router.urls













# # 这是订单路由的实现


router.register('orders',OrderModelViewSet,basename='order')
urlpatterns +=router.urls




























